UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WvUwzBI2gyT4hmcHQmgypTUsh0ObOSkfEMpeM1ws8LE='
WHERE
key_id = '796a9f908cb7dd8533e9cea8f698782c382f4534fec032d0e52317f8914d1168'
AND (
token = 'WvUwzBI2gyT4hmcHQmgypTUsh0ObOSkfEMpeM1ws8LE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)