UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0M1uHA/REek+d9uIytM2PSsCxAPRZ7wU2fqwY83gHnc='
WHERE
key_id = '6d9a550dc4410fcfce3e3713d1308dd07da523f0cc8f4e994393fc6542275f0d'
AND (
token = '0M1uHA/REek+d9uIytM2PSsCxAPRZ7wU2fqwY83gHnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)