UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nWBcQZZnsAKiDvwMAYqdtowKxeLlyu13csSx6+/0Y68='
WHERE
key_id = 'a81ce9d8f84f867261c93a6470503416da6445f6f4be0fe13ea4e7dc97f32275'
AND (
token = 'nWBcQZZnsAKiDvwMAYqdtowKxeLlyu13csSx6+/0Y68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)