UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xcvb4vfSQETq3vokW92zHRui6/5b0USXRa+7ZeB03KY=' 
WHERE 
  key_id = '19d00d45ec7c5ea3b20eaca299b326ac0ebb9120ecb4b2863005ec3f5e3c972a' 
  AND (
    token = 'Xcvb4vfSQETq3vokW92zHRui6/5b0USXRa+7ZeB03KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023