UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ZtiWZSh5A4GYga2INV5IP3h8Wro/2ykKHfjIyq00ps='
WHERE
key_id = 'd980a7f0b165a1030a9cf9a49434b54b1a895fef316f322f3b58fb65d94d46d4'
AND (
token = '4ZtiWZSh5A4GYga2INV5IP3h8Wro/2ykKHfjIyq00ps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)