UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yvdK6ReKKpa0V0I7LcknmGKLV/BlsNZG9tlF829y5A='
WHERE
key_id = 'deea87b874490e9c0e51e5e1c07fb50e1fba3a65ebbd6e202885c153f032ca42'
AND (
token = '6yvdK6ReKKpa0V0I7LcknmGKLV/BlsNZG9tlF829y5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)