UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2M6gLHQAmtU0cX0oNqOy6FKaYXk9rYfZHFnVoi4SXp0='
WHERE
key_id = '519083f15c0cf44ae2ed84f6f75d7223af88e3b5d7f28d67bb031f99a43751ba'
AND (
token = '2M6gLHQAmtU0cX0oNqOy6FKaYXk9rYfZHFnVoi4SXp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)