UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EF7qiP4El8cBdPyFOggShBnYu7zkjuKCvPSC57/Li4Q='
WHERE
key_id = 'd73adf1c7de0e46d2730e59fd11bc419eec43c14f0ed10d40f44d47c9e363779'
AND (
token = 'EF7qiP4El8cBdPyFOggShBnYu7zkjuKCvPSC57/Li4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)