UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWQMNVVPRaXqnTOCPmWhqbEIXjF0y339q8tbaNkizXU='
WHERE
key_id = '2fb47229ec77faa9a7fabe7ff3ab88f0ca0f7fc87aa0beedabcf2f63d6bd7482'
AND (
token = 'PWQMNVVPRaXqnTOCPmWhqbEIXjF0y339q8tbaNkizXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)