UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '16vy7R1BegCEyleBPcCrAVbmbORn5/hPAtWZqm8lqNU='
WHERE
key_id = '7dcf5be4f113f5ef42634f2a98c85100a24751c7195b123c19e1c15c62c54a07'
AND (
token = '16vy7R1BegCEyleBPcCrAVbmbORn5/hPAtWZqm8lqNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)