UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4b9i+DlfIj0GPAhY1wuE1BUK6FOUVPv/Y+8RWozVJj0='
WHERE
key_id = '2590b0f14342316cf6fc3dc70b1fb631f4ff05464a5a99398acbfa7ead87fd94'
AND (
token = '4b9i+DlfIj0GPAhY1wuE1BUK6FOUVPv/Y+8RWozVJj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)