UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sNbSit/JEDkjL9u8/gI9gXXH828bHZrqf35vk4hwb2A=' 
WHERE 
  key_id = 'dd12145054aba285fb3dc07ccfec5f621a37a6a1b592e62fc1cb4bd4f44a4169' 
  AND (
    token = 'sNbSit/JEDkjL9u8/gI9gXXH828bHZrqf35vk4hwb2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023