UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3aJAIAQ8fXg8Y6NcrCV8Ca/0v6O37fwGIdZ6gbFDaLc=' 
WHERE 
  key_id = 'c1f0a79a62dd82f5d678360b30ee963593403bfde28a4e6c77b9ddd66361220e' 
  AND (
    token = '3aJAIAQ8fXg8Y6NcrCV8Ca/0v6O37fwGIdZ6gbFDaLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022