UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bijcGcMSokNgWtP2xyE/+yEeDHN258LLKdg2gtKwXYI=' 
WHERE 
  key_id = '20c2fb1ef52e23198ae973524f231add8955973bd00ef9bf73b9663b4ac74b59' 
  AND (
    token = 'bijcGcMSokNgWtP2xyE/+yEeDHN258LLKdg2gtKwXYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036