UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esrB3SSul1Ywc2Ht9STt9Jduji+JX+bf/NNUIrn9l38=' 
WHERE 
  key_id = '5a4bdc2992ca91724be16f02d99af46c7f5531c939a9adb9d2870e0dbbf4adaf' 
  AND (
    token = 'esrB3SSul1Ywc2Ht9STt9Jduji+JX+bf/NNUIrn9l38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028