UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'It5nBtc3oltMfaeztJQAB3jg9uddD/tt7yszMBglzhI='
WHERE
key_id = 'f566ae8e54879220130665f73c746b2cb93e337e8bf79c8b3f21bd190b1387ef'
AND (
token = 'It5nBtc3oltMfaeztJQAB3jg9uddD/tt7yszMBglzhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)