UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J3+fLVkdJn0beGIOJjLratpDgFQnu0yE+Q5AJh7/Xtc=' 
WHERE 
  key_id = 'ff3bd6d04ea0e44c0a570cfbae84a4415ef762ccccac59b2d800fc4dc5e7571e' 
  AND (
    token = 'J3+fLVkdJn0beGIOJjLratpDgFQnu0yE+Q5AJh7/Xtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031