UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1o/M1hc+5qTrOjLGK0VtGogVzCrasiJFCFI3tcKZWLI='
WHERE
key_id = '45ff668839e36e3e38f53aaca3a2d8e4b21e5a90f8c53a00c4acdf34ac540849'
AND (
token = '1o/M1hc+5qTrOjLGK0VtGogVzCrasiJFCFI3tcKZWLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)