UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UYf8Kiov0TLrHqL0KR9ofJCw+WM1KjO1EfhyuK4FDWM='
WHERE
key_id = 'c6f4aa2dcd397f1ea89a416918f82b751f8294dcddf2c1010377cfbd6f4847cd'
AND (
token = 'UYf8Kiov0TLrHqL0KR9ofJCw+WM1KjO1EfhyuK4FDWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)