UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jmcATERAGpzUdqAPepS+lieUATW/3wmyVR6jO0IRtBA='
WHERE
key_id = 'a4bb84d44ea34a56037a95c0f01ddb7cde1f9fcdeb03733cfd34425303ce9e49'
AND (
token = 'jmcATERAGpzUdqAPepS+lieUATW/3wmyVR6jO0IRtBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)