UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P4k/AdvEkn94YN8YUumA+xnYmolFM8Ns3xjNOCrAIsQ='
WHERE
key_id = 'e6c6cd64cc722d1ec67122af62d2301be902b2c35b5c8d6e797e359babbbe7c8'
AND (
token = 'P4k/AdvEkn94YN8YUumA+xnYmolFM8Ns3xjNOCrAIsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)