UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXIzTOmGfiG4ILCPjOC/7fz7Gd5Oqhaqc5jot4v3mcM='
WHERE
key_id = '5ef84482e678fed155a61dac474b33b35af6ddf984fc4f60ed200d7f6142e33b'
AND (
token = 'RXIzTOmGfiG4ILCPjOC/7fz7Gd5Oqhaqc5jot4v3mcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)