UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zeqlCD/sMvoJonUm6ajIGdOs9QIiNSyNOhegaXdI98='
WHERE
key_id = '5c1dfaa378d5c5fbe3f8ed6bf754b72cbb5df2ff89276155fcec7be54016b8b3'
AND (
token = '4zeqlCD/sMvoJonUm6ajIGdOs9QIiNSyNOhegaXdI98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)