UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P0BFD/aqSnYKiqy2pqW/j0oVPQ7Qgfpt8cQ9SGG5R1s='
WHERE
key_id = '6e4e6802e1dfed551923db685bed3950490a6c1a63189e4d0d8befc8dbe92a2f'
AND (
token = 'P0BFD/aqSnYKiqy2pqW/j0oVPQ7Qgfpt8cQ9SGG5R1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)