UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1AlaCqL3NO7Crgbkbi/1U90C/LHK/GRE6HTaYlySF00=' 
WHERE 
  key_id = '2b25a1249a2190d60240808241c4b6eb3dd1cedc79e26f30f61f5789a2173b14' 
  AND (
    token = '1AlaCqL3NO7Crgbkbi/1U90C/LHK/GRE6HTaYlySF00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035