UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EvvTk1i17o0k7G6Ac/EspSI+fka17hcAbIxMWaYp/qw='
WHERE
key_id = 'ff77737116080496abe13008050e86bdfa95d0fd4585c7f26f5144a2d4d0e94f'
AND (
token = 'EvvTk1i17o0k7G6Ac/EspSI+fka17hcAbIxMWaYp/qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)