UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aKL/8jeRkZPV0RutVGkVATwK4qPxorkvHztXfguOowg=' 
WHERE 
  key_id = '4bf5337bab015640192a2ad0d8f8482178c2b002cfdaf6e0cb4efbf9b6520f56' 
  AND (
    token = 'aKL/8jeRkZPV0RutVGkVATwK4qPxorkvHztXfguOowg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031