UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eiIV+4je9RC6LQe/hCIBwMlcX1Z4vPHKgdCoBpdlVJA='
WHERE
key_id = 'ee4767cd4ba0660a6f76d70e232191123dc4e9bc69111a9e1356073a82080cae'
AND (
token = 'eiIV+4je9RC6LQe/hCIBwMlcX1Z4vPHKgdCoBpdlVJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)