UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k8dcPOGq+iZXdVwU9UXBcMlh5gPBUFxXFA05Qr9EA1w='
WHERE
key_id = '03c6a674c76620543a3adc1c241111ad9b3759a5a88e957a24743bbacfeb950b'
AND (
token = 'k8dcPOGq+iZXdVwU9UXBcMlh5gPBUFxXFA05Qr9EA1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)