UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uex6h88hHJm/PyekE+dKlc/Wp/o20AX9S8wHKg6JqxM='
WHERE
key_id = '062ad374498d35d9dc673b9faca4a86f87bc8eac1ec790aaa56f9c714862e59f'
AND (
token = 'uex6h88hHJm/PyekE+dKlc/Wp/o20AX9S8wHKg6JqxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)