UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dNZuJQSd+ndTfidjwJ1GQyflDIwxVsz0R2CEkiuvqQ='
WHERE
key_id = 'fca0eded633ea88191bafdc233b8c314ec54f6e49ffd37f54a31820156650a33'
AND (
token = '3dNZuJQSd+ndTfidjwJ1GQyflDIwxVsz0R2CEkiuvqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)