UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gFnanLDl4ZQ/KX08JbTSS94UPFByGvxNZSOhkX1dlmA='
WHERE
key_id = 'bb182f55e33ca1764a9a3d2cbe8bb86543ef39ec616eb49273b1fc40e7d41c20'
AND (
token = 'gFnanLDl4ZQ/KX08JbTSS94UPFByGvxNZSOhkX1dlmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)