UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ddhuoq/tak7z1CjNDlHZkCf70FjQHBNMr2oH1V/KSLo='
WHERE
key_id = '7df9839b196e889af79072737c10c1ee86c71fcbdbac49cc5dd9e6f50d852faa'
AND (
token = 'ddhuoq/tak7z1CjNDlHZkCf70FjQHBNMr2oH1V/KSLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)