UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p2FEjuQeROd4Wz7yvzu4pBIS5+prwzZKrSRFGVPVcvk=' 
WHERE 
  key_id = '84f5215c268141989752039e8e33ed044c63e0e0cff3d074bc1fde3e0c55f3de' 
  AND (
    token = 'p2FEjuQeROd4Wz7yvzu4pBIS5+prwzZKrSRFGVPVcvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031