UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uCllC1tz+mdVltJuwW+7VnJsjxRfSUnNTj/SF+BPKJE='
WHERE
key_id = 'b92bdb4efba9373987fe919d5018e9225cf7ba2734996924054b1187d175b064'
AND (
token = 'uCllC1tz+mdVltJuwW+7VnJsjxRfSUnNTj/SF+BPKJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)