UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OY0R57OjJJkfI6cwft21SfiPJiRDeNW+wfEZbTnvwYE='
WHERE
key_id = '1925a6043da29c19b694e29e0e94abd98f3bac7ecc99153d58bfacad2bc5c435'
AND (
token = 'OY0R57OjJJkfI6cwft21SfiPJiRDeNW+wfEZbTnvwYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)